<?php

/**
 * Comuna form base class.
 *
 * @method Comuna getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseComunaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDCOMUNA'     => new sfWidgetFormInputHidden(),
      'IDCIUDAD'     => new sfWidgetFormPropelChoice(array('model' => 'Ciudad', 'add_empty' => true)),
      'NOMBRECOMUNA' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IDCOMUNA'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdcomuna()), 'empty_value' => $this->getObject()->getIdcomuna(), 'required' => false)),
      'IDCIUDAD'     => new sfValidatorPropelChoice(array('model' => 'Ciudad', 'column' => 'IDCIUDAD', 'required' => false)),
      'NOMBRECOMUNA' => new sfValidatorString(array('max_length' => 30)),
    ));

    $this->widgetSchema->setNameFormat('comuna[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comuna';
  }


}
